<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>perlcygwin - Perl for Cygwin - Perldoc Browser</title>
    <link rel="search" href="https://perldoc.perl.org/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser">
    <link rel="canonical" href="https://perldoc.perl.org/perlcygwin">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" />
    <style>
      body {
        background: #f4f4f5;
        color: #020202;
      }
      .navbar-dark {
        background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0);
        background-repeat: repeat-x;
      }
      .navbar-dark .navbar-nav .nav-link,
      .navbar-dark .navbar-nav .nav-link:focus { color: #fff }
      .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 }
      #wrapperlicious {
        margin: 0 auto;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
        padding: 0;
      }
      #wrapperlicious h1 { font-size: 1.5em }
      #wrapperlicious h2 { font-size: 1.3em }
      #wrapperlicious h3 { font-size: 1.1em }
      #wrapperlicious h4 { font-size: 0.9em }
      #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3,
      #wrapperlicious h4, #wrapperlicious dt {
        color: #020202;
        margin-top: 1em;
        margin-bottom: 1em;
        position: relative;
        font-weight: bold;
      }
      #wrapperlicious a { color: inherit; text-decoration: underline }
      #wrapperlicious #toc { text-decoration: none }
      #wrapperlicious a:hover { color: #2a2a2a }
      #wrapperlicious a img { border: 0 }
      #wrapperlicious :not(pre) > code {
        color: inherit;
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 3px;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        padding: 0.3em;
      }
      #wrapperlicious dd {
        margin: 0;
        margin-left: 2em;
      }
      #wrapperlicious dt {
        color: #2a2a2a;
        font-weight: bold;
        margin-left: 0.9em;
      }
      #wrapperlicious p {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious li > p {
        margin-bottom: 0;
        margin-top: 0;
      }
      #wrapperlicious pre {
        border: 1px solid #c1c1c1;
        border-radius: 3px;
        font: 100% Consolas, Menlo, Monaco, monospace;
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious pre > code {
        display: block;
        background-color: #f6f6f6;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        line-height: 1.5em;
        text-align: left;
        white-space: pre;
        padding: 1em;
      }
      #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious ul {
        list-style-type: square;
      }
      #wrapperlicious ul ul {
        margin-bottom: 0px;
        margin-top: 0px;
      }
      #footer {
        font-size: 0.8em;
        padding-top: 0.5em;
        text-align: center;
      }
      #more {
        display: inline;
        font-size: 0.8em;
      }
      #perldocdiv {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        margin-left: auto;
        margin-right: auto;
        padding: 3em;
        padding-top: 1em;
        max-width: 960px;
      }
      #moduleversion { float: right }
      #wrapperlicious .leading-notice {
        font-style: italic;
        padding-left: 1em;
        margin-top: 1em;
        margin-bottom: 1em;
      }
      #wrapperlicious .permalink {
        display: none;
        left: -0.75em;
        position: absolute;
        padding-right: 0.25em;
        text-decoration: none;
      }
      #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink,
      #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink,
      #wrapperlicious dt:hover .permalink {
        display: block;
      }
    </style>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-KVNWBNT5FB');
      gtag('config', 'UA-50555-3');
    </script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="https://perldoc.perl.org/">Perldoc Browser</a>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perlcygwin.html#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.35.0</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-stable">
          <a class="dropdown-item" href="https://perldoc.perl.org/perlcygwin">Latest</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.2/perlcygwin">5.38.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.1/perlcygwin">5.38.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0/perlcygwin">5.38.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.3/perlcygwin">5.36.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.2/perlcygwin">5.36.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.1/perlcygwin">5.36.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.0/perlcygwin">5.36.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.3/perlcygwin">5.34.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.2/perlcygwin">5.34.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.1/perlcygwin">5.34.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.0/perlcygwin">5.34.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.1/perlcygwin">5.32.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.0/perlcygwin">5.32.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.3/perlcygwin">5.30.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.2/perlcygwin">5.30.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.1/perlcygwin">5.30.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.0/perlcygwin">5.30.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.3/perlcygwin">5.28.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.2/perlcygwin">5.28.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.1/perlcygwin">5.28.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.0/perlcygwin">5.28.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.3/perlcygwin">5.26.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.2/perlcygwin">5.26.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.1/perlcygwin">5.26.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.0/perlcygwin">5.26.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.4/perlcygwin">5.24.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.3/perlcygwin">5.24.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.2/perlcygwin">5.24.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.1/perlcygwin">5.24.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.0/perlcygwin">5.24.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.4/perlcygwin">5.22.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.3/perlcygwin">5.22.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.2/perlcygwin">5.22.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.1/perlcygwin">5.22.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.0/perlcygwin">5.22.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.3/perlcygwin">5.20.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.2/perlcygwin">5.20.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.1/perlcygwin">5.20.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.0/perlcygwin">5.20.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.4/perlcygwin">5.18.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.3/perlcygwin">5.18.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.2/perlcygwin">5.18.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.1/perlcygwin">5.18.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.0/perlcygwin">5.18.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.3/perlcygwin">5.16.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.2/perlcygwin">5.16.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.1/perlcygwin">5.16.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.0/perlcygwin">5.16.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.4/perlcygwin">5.14.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.3/perlcygwin">5.14.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.2/perlcygwin">5.14.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.1/perlcygwin">5.14.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.0/perlcygwin">5.14.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.5/perlcygwin">5.12.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.4/perlcygwin">5.12.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.3/perlcygwin">5.12.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.2/perlcygwin">5.12.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.1/perlcygwin">5.12.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.0/perlcygwin">5.12.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.1/perlcygwin">5.10.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.0/perlcygwin">5.10.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.9/perlcygwin">5.8.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.8/perlcygwin">5.8.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.7/perlcygwin">5.8.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.6/perlcygwin">5.8.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.5/perlcygwin">5.8.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.4/perlcygwin">5.8.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.3/perlcygwin">5.8.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.2/perlcygwin">5.8.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.1/perlcygwin">5.8.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.0/perlcygwin">5.8.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.2/perlcygwin">5.6.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.1/perlcygwin">5.6.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.0/perlcygwin">5.6.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_04/perlcygwin">5.005_04</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_03/perlcygwin">5.005_03</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_02/perlcygwin">5.005_02</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_01/perlcygwin">5.005_01</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005/perlcygwin">5.005</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perlcygwin.html#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-dev">
          <a class="dropdown-item" href="https://perldoc.perl.org/blead/perlcygwin">blead</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.6/perlcygwin">5.39.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.5/perlcygwin">5.39.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.4/perlcygwin">5.39.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.3/perlcygwin">5.39.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.2/perlcygwin">5.39.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.1/perlcygwin">5.39.1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC2/perlcygwin">5.38.0-RC2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC1/perlcygwin">5.38.0-RC1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.11/perlcygwin">5.37.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.10/perlcygwin">5.37.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.9/perlcygwin">5.37.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.8/perlcygwin">5.37.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.7/perlcygwin">5.37.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.6/perlcygwin">5.37.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.5/perlcygwin">5.37.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.4/perlcygwin">5.37.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.3/perlcygwin">5.37.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.2/perlcygwin">5.37.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.1/perlcygwin">5.37.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.0/perlcygwin">5.37.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.11/perlcygwin">5.35.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.10/perlcygwin">5.35.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.9/perlcygwin">5.35.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.8/perlcygwin">5.35.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.7/perlcygwin">5.35.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.6/perlcygwin">5.35.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.5/perlcygwin">5.35.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.4/perlcygwin">5.35.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.3/perlcygwin">5.35.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.2/perlcygwin">5.35.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.1/perlcygwin">5.35.1</a>
          <a class="dropdown-item active" href="perlcygwin.html">5.35.0</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perlcygwin.html#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-nav">
          <a class="dropdown-item" href="perl.html">Perl</a>
          <a class="dropdown-item" href="perlintro.html">Intro</a>
          <a class="dropdown-item" href="perl.html#Tutorials">Tutorials</a>
          <a class="dropdown-item" href="perlfaq.html">FAQs</a>
          <a class="dropdown-item" href="perl.html#Reference-Manual">Reference</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlop.html">Operators</a>
          <a class="dropdown-item" href="functions.html">Functions</a>
          <a class="dropdown-item" href="variables.html">Variables</a>
          <a class="dropdown-item" href="modules.html">Modules</a>
          <a class="dropdown-item" href="perlutil.html">Utilities</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlcommunity.html">Community</a>
          <a class="dropdown-item" href="perlhist.html">History</a>
        </div>
      </li>
    </ul>
    <ul class="navbar-nav">
      <script>
        function set_expand (expand) {
          var perldocdiv = document.getElementById('perldocdiv');
          var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width');
          var expanded = (width == '' || width == 'none') ? true : false;
          if (expand === null) {
            expand = !expanded;
          }
          if ((expand && !expanded) || (!expand && expanded)) {
            perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px');
            var button_classlist = document.getElementById('content-expand-button').classList;
            if (expand) {
              button_classlist.add('btn-light');
              button_classlist.remove('btn-outline-light');
            } else {
              button_classlist.add('btn-outline-light');
              button_classlist.remove('btn-light');
            }
          }
          return expand;
        }
        function toggle_expand () {
          var expand = set_expand(null);
          document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC';
        }
        function read_expand () {
          return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 });
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', function () {
            if (read_expand()) {
              set_expand(true);
            }
          });
        } else if (read_expand()) {
          set_expand(true);
        }
      </script>
      <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-2" onclick="toggle_expand()">Expand</button>
    <ul>
    <form class="form-inline" method="get" action="https://perldoc.perl.org/5.35.0/search">
      <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search">
    </form>
  </div>
</nav>

    <div id="wrapperlicious" class="container-fluid">
      <div id="perldocdiv">
        <div id="links">
          <a href="perlcygwin.html">perlcygwin</a>
          <div id="more">
            (<a href="perlcygwin.txt">source</a>,
            <a href="https://metacpan.org/pod/perlcygwin">CPAN</a>)
          </div>
        </div>
        <div class="leading-notice">
          You are viewing the version of this documentation from Perl 5.35.0.
            This is a development version of Perl.
        </div>
        <h1><a id="toc">CONTENTS</a></h1>
                  <ul>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#NAME">NAME</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#SYNOPSIS">SYNOPSIS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#PREREQUISITES-FOR-COMPILING-PERL-ON-CYGWIN">PREREQUISITES FOR COMPILING PERL ON CYGWIN</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#Cygwin-=-GNU+Cygnus+Windows-(Don&#39;t-leave-UNIX-without-it)">Cygwin = GNU+Cygnus+Windows (Don&#39;t leave UNIX without it)</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#Cygwin-Configuration">Cygwin Configuration</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#CONFIGURE-PERL-ON-CYGWIN">CONFIGURE PERL ON CYGWIN</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#Stripping-Perl-Binaries-on-Cygwin">Stripping Perl Binaries on Cygwin</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#Optional-Libraries-for-Perl-on-Cygwin">Optional Libraries for Perl on Cygwin</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#Configure-time-Options-for-Perl-on-Cygwin">Configure-time Options for Perl on Cygwin</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#Suspicious-Warnings-on-Cygwin">Suspicious Warnings on Cygwin</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#MAKE-ON-CYGWIN">MAKE ON CYGWIN</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#TEST-ON-CYGWIN">TEST ON CYGWIN</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#File-Permissions-on-Cygwin">File Permissions on Cygwin</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#NDBM_File-and-ODBM_File-do-not-work-on-FAT-filesystems">NDBM_File and ODBM_File do not work on FAT filesystems</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#fork()-failures-in-io_*-tests">fork() failures in io_* tests</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#Specific-features-of-the-Cygwin-port">Specific features of the Cygwin port</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#Script-Portability-on-Cygwin">Script Portability on Cygwin</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#Prebuilt-methods:">Prebuilt methods:</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#INSTALL-PERL-ON-CYGWIN">INSTALL PERL ON CYGWIN</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#MANIFEST-ON-CYGWIN">MANIFEST ON CYGWIN</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#BUGS-ON-CYGWIN">BUGS ON CYGWIN</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#AUTHORS">AUTHORS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perlcygwin.html#HISTORY">HISTORY</a>
              </li>
          </ul>

      <h1 id="NAME"><a class="permalink" href="perlcygwin.html#NAME">#</a>NAME</h1>

<p>perlcygwin - Perl for Cygwin</p>

<h1 id="SYNOPSIS"><a class="permalink" href="perlcygwin.html#SYNOPSIS">#</a>SYNOPSIS</h1>

<p>This document will help you configure, make, test and install Perl on Cygwin. This document also describes features of Cygwin that will affect how Perl behaves at runtime.</p>

<p><b>NOTE:</b> There are pre-built Perl packages available for Cygwin and a version of Perl is provided in the normal Cygwin install. If you do not need to customize the configuration, consider using one of those packages.</p>

<h1 id="PREREQUISITES-FOR-COMPILING-PERL-ON-CYGWIN"><a class="permalink" href="perlcygwin.html#PREREQUISITES-FOR-COMPILING-PERL-ON-CYGWIN">#</a><a id="PREREQUISITES"></a>PREREQUISITES FOR COMPILING PERL ON CYGWIN</h1>

<h2 id="Cygwin-=-GNU+Cygnus+Windows-(Don&#39;t-leave-UNIX-without-it)"><a class="permalink" href="perlcygwin.html#Cygwin-=-GNU+Cygnus+Windows-(Don&#39;t-leave-UNIX-without-it)">#</a><a id="Cygwin"></a><a id="Cygwin-GNU-Cygnus-Windows-Dont-leave-UNIX-without-it"></a>Cygwin = GNU+Cygnus+Windows (Don&#39;t leave UNIX without it)</h2>

<p>The Cygwin tools are ports of the popular GNU development tools for Win32 platforms. They run thanks to the Cygwin library which provides the UNIX system calls and environment these programs expect. More information about this project can be found at:</p>

<p><a href="https://www.cygwin.com/">https://www.cygwin.com/</a></p>

<p>A recent net or commercial release of Cygwin is required.</p>

<p>At the time this document was last updated, Cygwin 1.7.16 was current.</p>

<h2 id="Cygwin-Configuration"><a class="permalink" href="perlcygwin.html#Cygwin-Configuration">#</a><a id="Cygwin1"></a>Cygwin Configuration</h2>

<p>While building Perl some changes may be necessary to your Cygwin setup so that Perl builds cleanly. These changes are <b>not</b> required for normal Perl usage.</p>

<p><b>NOTE:</b> The binaries that are built will run on all Win32 versions. They do not depend on your host system (WinXP/Win2K/Win7) or your Cygwin configuration (binary/text mounts, cvgserver). The only dependencies come from hard-coded pathnames like <i>/usr/local</i>. However, your host system and Cygwin configuration will affect Perl&#39;s runtime behavior (see <a href="perlcygwin.html#TEST">&quot;TEST&quot;</a>).</p>

<ul>

<li><p><code>PATH</code></p>

<p>Set the <code>PATH</code> environment variable so that Configure finds the Cygwin versions of programs. Any not-needed Windows directories should be removed or moved to the end of your <code>PATH</code>.</p>

</li>
<li><p><i>nroff</i></p>

<p>If you do not have <i>nroff</i> (which is part of the <i>groff</i> package), Configure will <b>not</b> prompt you to install <i>man</i> pages.</p>

</li>
</ul>

<h1 id="CONFIGURE-PERL-ON-CYGWIN"><a class="permalink" href="perlcygwin.html#CONFIGURE-PERL-ON-CYGWIN">#</a><a id="CONFIGURE"></a>CONFIGURE PERL ON CYGWIN</h1>

<p>The default options gathered by Configure with the assistance of <i>hints/cygwin.sh</i> will build a Perl that supports dynamic loading (which requires a shared <i>cygperl5_16.dll</i>).</p>

<p>This will run Configure and keep a record:</p>

<pre><code class="plaintext">./Configure 2&gt;&amp;1 | tee log.configure</code></pre>

<p>If you are willing to accept all the defaults run Configure with <b>-de</b>. However, several useful customizations are available.</p>

<h2 id="Stripping-Perl-Binaries-on-Cygwin"><a class="permalink" href="perlcygwin.html#Stripping-Perl-Binaries-on-Cygwin">#</a><a id="Stripping"></a>Stripping Perl Binaries on Cygwin</h2>

<p>It is possible to strip the EXEs and DLLs created by the build process. The resulting binaries will be significantly smaller. If you want the binaries to be stripped, you can either add a <b>-s</b> option when Configure prompts you,</p>

<pre><code class="plaintext">Any additional ld flags (NOT including libraries)? [none] -s
Any special flags to pass to g++ to create a dynamically loaded
library?
[none] -s
Any special flags to pass to gcc to use dynamic linking? [none] -s</code></pre>

<p>or you can edit <i>hints/cygwin.sh</i> and uncomment the relevant variables near the end of the file.</p>

<h2 id="Optional-Libraries-for-Perl-on-Cygwin"><a class="permalink" href="perlcygwin.html#Optional-Libraries-for-Perl-on-Cygwin">#</a><a id="Optional"></a>Optional Libraries for Perl on Cygwin</h2>

<p>Several Perl functions and modules depend on the existence of some optional libraries. Configure will find them if they are installed in one of the directories listed as being used for library searches. Pre-built packages for most of these are available from the Cygwin installer.</p>

<ul>

<li><p><code>-lcrypt</code></p>

<p>The crypt package distributed with Cygwin is a Linux compatible 56-bit DES crypt port by Corinna Vinschen.</p>

<p>Alternatively, the crypt libraries in GNU libc have been ported to Cygwin.</p>

<p>As of libcrypt 1.3 (March 2016), you will need to install the libcrypt-devel package for Configure to detect crypt().</p>

</li>
<li><p><code>-lgdbm_compat</code> (<code>use GDBM_File</code>)</p>

<p>GDBM is available for Cygwin.</p>

<p>NOTE: The GDBM library only works on NTFS partitions.</p>

</li>
<li><p><code>-ldb</code> (<code>use DB_File</code>)</p>

<p>BerkeleyDB is available for Cygwin.</p>

<p>NOTE: The BerkeleyDB library only completely works on NTFS partitions.</p>

</li>
<li><p><code>cygserver</code> (<code>use IPC::SysV</code>)</p>

<p>A port of SysV IPC is available for Cygwin.</p>

<p>NOTE: This has <b>not</b> been extensively tested. In particular, <code>d_semctl_semun</code> is undefined because it fails a Configure test and on Win9x the <i>shm*()</i> functions seem to hang. It also creates a compile time dependency because <i>perl.h</i> includes <i>&lt;sys/ipc.h</i>&gt; and <i>&lt;sys/sem.h</i>&gt; (which will be required in the future when compiling CPAN modules). CURRENTLY NOT SUPPORTED!</p>

</li>
<li><p><code>-lutil</code></p>

<p>Included with the standard Cygwin netrelease is the inetutils package which includes libutil.a.</p>

</li>
</ul>

<h2 id="Configure-time-Options-for-Perl-on-Cygwin"><a class="permalink" href="perlcygwin.html#Configure-time-Options-for-Perl-on-Cygwin">#</a><a id="Configure"></a>Configure-time Options for Perl on Cygwin</h2>

<p>The <i>INSTALL</i> document describes several Configure-time options. Some of these will work with Cygwin, others are not yet possible. Also, some of these are experimental. You can either select an option when Configure prompts you or you can define (undefine) symbols on the command line.</p>

<ul>

<li><p><code>-Uusedl</code></p>

<p>Undefining this symbol forces Perl to be compiled statically.</p>

</li>
<li><p><code>-Dusemymalloc</code></p>

<p>By default Perl does not use the <code>malloc()</code> included with the Perl source, because it was slower and not entirely thread-safe. If you want to force Perl to build with the old -Dusemymalloc define this.</p>

</li>
<li><p><code>-Uuseperlio</code></p>

<p>Undefining this symbol disables the PerlIO abstraction. PerlIO is now the default; it is not recommended to disable PerlIO.</p>

</li>
<li><p><code>-Dusemultiplicity</code></p>

<p>Multiplicity is required when embedding Perl in a C program and using more than one interpreter instance. This is only required when you build a not-threaded perl with <code>-Uuseithreads</code>.</p>

</li>
<li><p><code>-Uuse64bitint</code></p>

<p>By default Perl uses 64 bit integers. If you want to use smaller 32 bit integers, define this symbol.</p>

</li>
<li><p><code>-Duselongdouble</code></p>

<p><i>gcc</i> supports long doubles (12 bytes). However, several additional long double math functions are necessary to use them within Perl (<i>{atan2, cos, exp, floor, fmod, frexp, isnan, log, modf, pow, sin, sqrt}l, strtold</i>). These are <b>not</b> yet available with newlib, the Cygwin libc.</p>

</li>
<li><p><code>-Uuseithreads</code></p>

<p>Define this symbol if you want not-threaded faster perl.</p>

</li>
<li><p><code>-Duselargefiles</code></p>

<p>Cygwin uses 64-bit integers for internal size and position calculations, this will be correctly detected and defined by Configure.</p>

</li>
<li><p><code>-Dmksymlinks</code></p>

<p>Use this to build perl outside of the source tree. Details can be found in the <i>INSTALL</i> document. This is the recommended way to build perl from sources.</p>

</li>
</ul>

<h2 id="Suspicious-Warnings-on-Cygwin"><a class="permalink" href="perlcygwin.html#Suspicious-Warnings-on-Cygwin">#</a><a id="Suspicious"></a>Suspicious Warnings on Cygwin</h2>

<p>You may see some messages during Configure that seem suspicious.</p>

<ul>

<li><p>Win9x and <code>d_eofnblk</code></p>

<p>Win9x does not correctly report <code>EOF</code> with a non-blocking read on a closed pipe. You will see the following messages:</p>

<pre><code>But it also returns -1 to signal EOF, so be careful!
WARNING: you can&#39;t distinguish between EOF and no data!

*** WHOA THERE!!! ***
    The recommended value for $d_eofnblk on this machine was
    &quot;define&quot;!
    Keep the recommended value? [y]</code></pre>

<p>At least for consistency with WinNT, you should keep the recommended value.</p>

</li>
<li><p>Compiler/Preprocessor defines</p>

<p>The following error occurs because of the Cygwin <code>#define</code> of <code>_LONG_DOUBLE</code>:</p>

<pre><code class="plaintext">Guessing which symbols your C compiler and preprocessor define...
try.c:&lt;line#&gt;: missing binary operator</code></pre>

<p>This failure does not seem to cause any problems. With older gcc versions, &quot;parse error&quot; is reported instead of &quot;missing binary operator&quot;.</p>

</li>
</ul>

<h1 id="MAKE-ON-CYGWIN"><a class="permalink" href="perlcygwin.html#MAKE-ON-CYGWIN">#</a><a id="MAKE"></a>MAKE ON CYGWIN</h1>

<p>Simply run <i>make</i> and wait:</p>

<pre><code class="plaintext">make 2&gt;&amp;1 | tee log.make</code></pre>

<h1 id="TEST-ON-CYGWIN"><a class="permalink" href="perlcygwin.html#TEST-ON-CYGWIN">#</a><a id="TEST"></a>TEST ON CYGWIN</h1>

<p>There are two steps to running the test suite:</p>

<pre><code class="plaintext">make test 2&gt;&amp;1 | tee log.make-test

cd t; ./perl harness 2&gt;&amp;1 | tee ../log.harness</code></pre>

<p>The same tests are run both times, but more information is provided when running as <code>./perl harness</code>.</p>

<p>Test results vary depending on your host system and your Cygwin configuration. If a test can pass in some Cygwin setup, it is always attempted and explainable test failures are documented. It is possible for Perl to pass all the tests, but it is more likely that some tests will fail for one of the reasons listed below.</p>

<h2 id="File-Permissions-on-Cygwin"><a class="permalink" href="perlcygwin.html#File-Permissions-on-Cygwin">#</a><a id="File"></a>File Permissions on Cygwin</h2>

<p>UNIX file permissions are based on sets of mode bits for {read,write,execute} for each {user,group,other}. By default Cygwin only tracks the Win32 read-only attribute represented as the UNIX file user write bit (files are always readable, files are executable if they have a <i>.{com,bat,exe}</i> extension or begin with <code>#!</code>, directories are always readable and executable). On WinNT with the <i>ntea</i> <code>CYGWIN</code> setting, the additional mode bits are stored as extended file attributes. On WinNT with the default <i>ntsec</i> <code>CYGWIN</code> setting, permissions use the standard WinNT security descriptors and access control lists. Without one of these options, these tests will fail (listing not updated yet):</p>

<pre><code class="plaintext">Failed Test           List of failed
------------------------------------
io/fs.t               5, 7, 9-10
lib/anydbm.t          2
lib/db-btree.t        20
lib/db-hash.t         16
lib/db-recno.t        18
lib/gdbm.t            2
lib/ndbm.t            2
lib/odbm.t            2
lib/sdbm.t            2
op/stat.t             9, 20 (.tmp not an executable extension)</code></pre>

<h2 id="NDBM_File-and-ODBM_File-do-not-work-on-FAT-filesystems"><a class="permalink" href="perlcygwin.html#NDBM_File-and-ODBM_File-do-not-work-on-FAT-filesystems">#</a><a id="NDBM_File"></a>NDBM_File and ODBM_File do not work on FAT filesystems</h2>

<p>Do not use NDBM_File or ODBM_File on FAT filesystem. They can be built on a FAT filesystem, but many tests will fail:</p>

<pre><code class="plaintext">../ext/NDBM_File/ndbm.t       13  3328    71   59  83.10%  1-2 4 16-71
../ext/ODBM_File/odbm.t      255 65280    ??   ??       %  ??
../lib/AnyDBM_File.t           2   512    12    2  16.67%  1 4
../lib/Memoize/t/errors.t      0   139    11    5  45.45%  7-11
../lib/Memoize/t/tie_ndbm.t   13  3328     4    4 100.00%  1-4
run/fresh_perl.t                          97    1   1.03%  91</code></pre>

<p>If you intend to run only on FAT (or if using AnyDBM_File on FAT), run Configure with the -Ui_ndbm and -Ui_dbm options to prevent NDBM_File and ODBM_File being built.</p>

<p>With NTFS (and no CYGWIN=nontsec), there should be no problems even if perl was built on FAT.</p>

<h2 id="fork()-failures-in-io_*-tests"><a class="permalink" href="perlcygwin.html#fork()-failures-in-io_*-tests">#</a><a id="fork"></a><a id="fork-failures-in-io_-tests"></a><code>fork()</code> failures in io_* tests</h2>

<p>A <code>fork()</code> failure may result in the following tests failing:</p>

<pre><code class="plaintext">ext/IO/lib/IO/t/io_multihomed.t
ext/IO/lib/IO/t/io_sock.t
ext/IO/lib/IO/t/io_unix.t</code></pre>

<p>See comment on fork in <a href="perlcygwin.html#Miscellaneous">&quot;Miscellaneous&quot;</a> below.</p>

<h1 id="Specific-features-of-the-Cygwin-port"><a class="permalink" href="perlcygwin.html#Specific-features-of-the-Cygwin-port">#</a><a id="Specific"></a>Specific features of the Cygwin port</h1>

<h2 id="Script-Portability-on-Cygwin"><a class="permalink" href="perlcygwin.html#Script-Portability-on-Cygwin">#</a><a id="Script"></a>Script Portability on Cygwin</h2>

<p>Cygwin does an outstanding job of providing UNIX-like semantics on top of Win32 systems. However, in addition to the items noted above, there are some differences that you should know about. This is a very brief guide to portability, more information can be found in the Cygwin documentation.</p>

<ul>

<li><p>Pathnames</p>

<p>Cygwin pathnames are separated by forward (<i>/</i>) slashes, Universal Naming Codes (<i>//UNC</i>) are also supported Since cygwin-1.7 non-POSIX pathnames are discouraged. Names may contain all printable characters.</p>

<p>File names are case insensitive, but case preserving. A pathname that contains a backslash or drive letter is a Win32 pathname, and not subject to the translations applied to POSIX style pathnames, but cygwin will warn you, so better convert them to POSIX.</p>

<p>For conversion we have <code>Cygwin::win_to_posix_path()</code> and <code>Cygwin::posix_to_win_path()</code>.</p>

<p>Since cygwin-1.7 pathnames are UTF-8 encoded.</p>

</li>
<li><p>Text/Binary</p>

<p>Since cygwin-1.7 textmounts are deprecated and strongly discouraged.</p>

<p>When a file is opened it is in either text or binary mode. In text mode a file is subject to CR/LF/Ctrl-Z translations. With Cygwin, the default mode for an <code>open()</code> is determined by the mode of the mount that underlies the file. See <a href="perlcygwin.html#Cygwin%3A%3Ais_binmount">&quot;Cygwin::is_binmount&quot;</a>(). Perl provides a <code>binmode()</code> function to set binary mode on files that otherwise would be treated as text. <code>sysopen()</code> with the <code>O_TEXT</code> flag sets text mode on files that otherwise would be treated as binary:</p>

<pre><code class="plaintext">sysopen(FOO, &quot;bar&quot;, O_WRONLY|O_CREAT|O_TEXT)</code></pre>

<p><code>lseek()</code>, <code>tell()</code> and <code>sysseek()</code> only work with files opened in binary mode.</p>

<p>The text/binary issue is covered at length in the Cygwin documentation.</p>

</li>
<li><p>PerlIO</p>

<p>PerlIO overrides the default Cygwin Text/Binary behaviour. A file will always be treated as binary, regardless of the mode of the mount it lives on, just like it is in UNIX. So CR/LF translation needs to be requested in either the <code>open()</code> call like this:</p>

<pre><code>open(FH, &quot;&gt;:crlf&quot;, &quot;out.txt&quot;);</code></pre>

<p>which will do conversion from LF to CR/LF on the output, or in the environment settings (add this to your .bashrc):</p>

<pre><code class="plaintext">export PERLIO=crlf</code></pre>

<p>which will pull in the crlf PerlIO layer which does LF -&gt; CRLF conversion on every output generated by perl.</p>

</li>
<li><p><i>.exe</i></p>

<p>The Cygwin <code>stat()</code>, <code>lstat()</code> and <code>readlink()</code> functions make the <i>.exe</i> extension transparent by looking for <i>foo.exe</i> when you ask for <i>foo</i> (unless a <i>foo</i> also exists). Cygwin does not require a <i>.exe</i> extension, but <i>gcc</i> adds it automatically when building a program. However, when accessing an executable as a normal file (e.g., <i>cp</i> in a makefile) the <i>.exe</i> is not transparent. The <i>install</i> program included with Cygwin automatically appends a <i>.exe</i> when necessary.</p>

</li>
<li><p>Cygwin vs. Windows process ids</p>

<p>Cygwin processes have their own pid, which is different from the underlying windows pid. Most posix compliant Proc functions expect the cygwin pid, but several Win32::Process functions expect the winpid. E.g. <code>$$</code> is the cygwin pid of <i>/usr/bin/perl</i>, which is not the winpid. Use <code>Cygwin::pid_to_winpid()</code> and <code>Cygwin::winpid_to_pid()</code> to translate between them.</p>

</li>
<li><p>Cygwin vs. Windows errors</p>

<p>Under Cygwin, $^E is the same as $!. When using <a href="Win32.html">Win32 API Functions</a>, use <code>Win32::GetLastError()</code> to get the last Windows error.</p>

</li>
<li><p>rebase errors on fork or system</p>

<p>Using <code>fork()</code> or <code>system()</code> out to another perl after loading multiple dlls may result on a DLL baseaddress conflict. The internal cygwin error looks like like the following:</p>

<pre><code class="plaintext">0 [main] perl 8916 child_info_fork::abort: data segment start:
parent (0xC1A000) != child(0xA6A000)</code></pre>

<p>or:</p>

<pre><code class="plaintext">183 [main] perl 3588 C:\cygwin\bin\perl.exe: *** fatal error -
unable to remap C:\cygwin\bin\cygsvn_subr-1-0.dll to same address
as parent(0x6FB30000) != 0x6FE60000 46 [main] perl 3488 fork: child
3588 - died waiting for dll loading, errno11</code></pre>

<p>See <a href="https://cygwin.com/faq/faq-nochunks.html#faq.using.fixing-fork-failures">https://cygwin.com/faq/faq-nochunks.html#faq.using.fixing-fork-failures</a> It helps if not too many DLLs are loaded in memory so the available address space is larger, e.g. stopping the MS Internet Explorer might help.</p>

<p>Use the perlrebase or rebase utilities to resolve the conflicting dll addresses. The rebase package is included in the Cygwin setup. Use <i>setup.exe</i> from <a href="https://cygwin.com/install.html">https://cygwin.com/install.html</a> to install it.</p>

<p>1. kill all perl processes and run <code>perlrebase</code> or</p>

<p>2. kill all cygwin processes and services, start dash from cmd.exe and run <code>rebaseall</code>.</p>

</li>
<li><p><code>chown()</code></p>

<p>On WinNT <code>chown()</code> can change a file&#39;s user and group IDs. On Win9x <code>chown()</code> is a no-op, although this is appropriate since there is no security model.</p>

</li>
<li><p>Miscellaneous</p>

<p>File locking using the <code>F_GETLK</code> command to <code>fcntl()</code> is a stub that returns <code>ENOSYS</code>.</p>

<p>Win9x can not <code>rename()</code> an open file (although WinNT can).</p>

<p>The Cygwin <code>chroot()</code> implementation has holes (it can not restrict file access by native Win32 programs).</p>

<p>Inplace editing <code>perl -i</code> of files doesn&#39;t work without doing a backup of the file being edited <code>perl -i.bak</code> because of windowish restrictions, therefore Perl adds the suffix <code>.bak</code> automatically if you use <code>perl -i</code> without specifying a backup extension.</p>

</li>
</ul>

<h2 id="Prebuilt-methods:"><a class="permalink" href="perlcygwin.html#Prebuilt-methods:">#</a><a id="Prebuilt"></a><a id="Prebuilt-methods"></a>Prebuilt methods:</h2>

<dl>

<dt id="Cwd::cwd"><a class="permalink" href="perlcygwin.html#Cwd::cwd">#</a><a id="Cwd"></a><code>Cwd::cwd</code></dt>
<dd>

<p>Returns the current working directory.</p>

</dd>
<dt id="Cygwin::pid_to_winpid"><a class="permalink" href="perlcygwin.html#Cygwin::pid_to_winpid">#</a><a id="Cygwin2"></a><code>Cygwin::pid_to_winpid</code></dt>
<dd>

<p>Translates a cygwin pid to the corresponding Windows pid (which may or may not be the same).</p>

</dd>
<dt id="Cygwin::winpid_to_pid"><a class="permalink" href="perlcygwin.html#Cygwin::winpid_to_pid">#</a><a id="Cygwin3"></a><code>Cygwin::winpid_to_pid</code></dt>
<dd>

<p>Translates a Windows pid to the corresponding cygwin pid (if any).</p>

</dd>
<dt id="Cygwin::win_to_posix_path"><a class="permalink" href="perlcygwin.html#Cygwin::win_to_posix_path">#</a><a id="Cygwin4"></a><code>Cygwin::win_to_posix_path</code></dt>
<dd>

<p>Translates a Windows path to the corresponding cygwin path respecting the current mount points. With a second non-null argument returns an absolute path. Double-byte characters will not be translated.</p>

</dd>
<dt id="Cygwin::posix_to_win_path"><a class="permalink" href="perlcygwin.html#Cygwin::posix_to_win_path">#</a><a id="Cygwin5"></a><code>Cygwin::posix_to_win_path</code></dt>
<dd>

<p>Translates a cygwin path to the corresponding cygwin path respecting the current mount points. With a second non-null argument returns an absolute path. Double-byte characters will not be translated.</p>

</dd>
<dt id="Cygwin::mount_table()"><a class="permalink" href="perlcygwin.html#Cygwin::mount_table()">#</a><a id="Cygwin6"></a><a id="Cygwin::mount_table"></a><code>Cygwin::mount_table()</code></dt>
<dd>

<p>Returns an array of [mnt_dir, mnt_fsname, mnt_type, mnt_opts].</p>

<pre><code>perl -e &#39;for $i (Cygwin::mount_table) {print join(&quot; &quot;,@$i),&quot;\n&quot;;}&#39;
/bin c:\cygwin\bin system binmode,cygexec
/usr/bin c:\cygwin\bin system binmode
/usr/lib c:\cygwin\lib system binmode
/ c:\cygwin system binmode
/cygdrive/c c: system binmode,noumount
/cygdrive/d d: system binmode,noumount
/cygdrive/e e: system binmode,noumount</code></pre>

</dd>
<dt id="Cygwin::mount_flags"><a class="permalink" href="perlcygwin.html#Cygwin::mount_flags">#</a><a id="Cygwin7"></a><code>Cygwin::mount_flags</code></dt>
<dd>

<p>Returns the mount type and flags for a specified mount point. A comma-separated string of mntent-&gt;mnt_type (always &quot;system&quot; or &quot;user&quot;), then the mntent-&gt;mnt_opts, where the first is always &quot;binmode&quot; or &quot;textmode&quot;.</p>

<pre><code class="plaintext">system|user,binmode|textmode,exec,cygexec,cygdrive,mixed,
notexec,managed,nosuid,devfs,proc,noumount</code></pre>

<p>If the argument is &quot;/cygdrive&quot;, then just the volume mount settings, and the cygdrive mount prefix are returned.</p>

<p>User mounts override system mounts.</p>

<pre><code class="plaintext">$ perl -e &#39;print Cygwin::mount_flags &quot;/usr/bin&quot;&#39;
system,binmode,cygexec
$ perl -e &#39;print Cygwin::mount_flags &quot;/cygdrive&quot;&#39;
binmode,cygdrive,/cygdrive</code></pre>

</dd>
<dt id="Cygwin::is_binmount"><a class="permalink" href="perlcygwin.html#Cygwin::is_binmount">#</a><a id="Cygwin8"></a><code>Cygwin::is_binmount</code></dt>
<dd>

<p>Returns true if the given cygwin path is binary mounted, false if the path is mounted in textmode.</p>

</dd>
<dt id="Cygwin::sync_winenv"><a class="permalink" href="perlcygwin.html#Cygwin::sync_winenv">#</a><a id="Cygwin9"></a><code>Cygwin::sync_winenv</code></dt>
<dd>

<p>Cygwin does not initialize all original Win32 environment variables. See the bottom of this page <a href="https://cygwin.com/cygwin-ug-net/setup-env.html">https://cygwin.com/cygwin-ug-net/setup-env.html</a> for &quot;Restricted Win32 environment&quot;.</p>

<p>Certain Win32 programs called from cygwin programs might need some environment variable, such as e.g. ADODB needs %COMMONPROGRAMFILES%. Call Cygwin::sync_winenv() to copy all Win32 environment variables to your process and note that cygwin will warn on every encounter of non-POSIX paths.</p>

</dd>
</dl>

<h1 id="INSTALL-PERL-ON-CYGWIN"><a class="permalink" href="perlcygwin.html#INSTALL-PERL-ON-CYGWIN">#</a><a id="INSTALL"></a>INSTALL PERL ON CYGWIN</h1>

<p>This will install Perl, including <i>man</i> pages.</p>

<pre><code class="plaintext">make install 2&gt;&amp;1 | tee log.make-install</code></pre>

<p>NOTE: If <code>STDERR</code> is redirected <code>make install</code> will <b>not</b> prompt you to install <i>perl</i> into <i>/usr/bin</i>.</p>

<p>You may need to be <i>Administrator</i> to run <code>make install</code>. If you are not, you must have write access to the directories in question.</p>

<p>Information on installing the Perl documentation in HTML format can be found in the <i>INSTALL</i> document.</p>

<h1 id="MANIFEST-ON-CYGWIN"><a class="permalink" href="perlcygwin.html#MANIFEST-ON-CYGWIN">#</a><a id="MANIFEST"></a>MANIFEST ON CYGWIN</h1>

<p>These are the files in the Perl release that contain references to Cygwin. These very brief notes attempt to explain the reason for all conditional code. Hopefully, keeping this up to date will allow the Cygwin port to be kept as clean as possible.</p>

<dl>

<dt id="Documentation"><a class="permalink" href="perlcygwin.html#Documentation">#</a>Documentation</dt>
<dd>

<pre><code class="plaintext">INSTALL README.cygwin README.win32 MANIFEST
pod/perl.pod pod/perlport.pod pod/perlfaq3.pod
pod/perldelta.pod pod/perl5004delta.pod pod/perl56delta.pod
pod/perl561delta.pod pod/perl570delta.pod pod/perl572delta.pod
pod/perl573delta.pod pod/perl58delta.pod pod/perl581delta.pod
pod/perl590delta.pod pod/perlhist.pod pod/perlmodlib.pod
pod/perltoc.pod Porting/Glossary pod/perlgit.pod
Porting/checkAUTHORS.pl
dist/Cwd/Changes ext/Compress-Raw-Zlib/Changes
dist/Time-HiRes/Changes
ext/Compress-Raw-Zlib/README ext/Compress-Zlib/Changes
ext/DB_File/Changes ext/Encode/Changes ext/Sys-Syslog/Changes
ext/Win32API-File/Changes
lib/ExtUtils/CBuilder/Changes lib/ExtUtils/Changes
lib/ExtUtils/NOTES lib/ExtUtils/PATCHING lib/ExtUtils/README
lib/Net/Ping/Changes lib/Test/Harness/Changes
lib/Term/ANSIColor/ChangeLog lib/Term/ANSIColor/README</code></pre>

</dd>
<dt id="Build,-Configure,-Make,-Install"><a class="permalink" href="perlcygwin.html#Build,-Configure,-Make,-Install">#</a><a id="Build"></a><a id="Build-Configure-Make-Install"></a>Build, Configure, Make, Install</dt>
<dd>

<pre><code class="plaintext">cygwin/Makefile.SHs
ext/IPC/SysV/hints/cygwin.pl
ext/NDBM_File/hints/cygwin.pl
ext/ODBM_File/hints/cygwin.pl
hints/cygwin.sh
Configure             - help finding hints from uname,
                        shared libperl required for dynamic loading
Makefile.SH Cross/Makefile-cross-SH
                      - linklibperl
Porting/patchls       - cygwin in port list
installman            - man pages with :: translated to .
installperl           - install dll, install to &#39;pods&#39;
makedepend.SH         - uwinfix
regen_lib.pl          - file permissions

NetWare/Makefile
plan9/mkfile
hints/uwin.sh
vms/descrip_mms.template
win32/Makefile</code></pre>

</dd>
<dt id="Tests"><a class="permalink" href="perlcygwin.html#Tests">#</a>Tests</dt>
<dd>

<pre><code class="plaintext">t/io/fs.t             - no file mode checks if not ntsec
                        skip rename() check when not
                        check_case:relaxed
t/io/tell.t           - binmode
t/lib/cygwin.t        - builtin cygwin function tests
t/op/groups.t         - basegroup has ID = 0
t/op/magic.t          - $^X/symlink WORKAROUND, s/.exe//
t/op/stat.t           - no /dev, skip Win32 ftCreationTime quirk
                        (cache manager sometimes preserves ctime of
                        file previously created and deleted), no -u
                        (setuid)
t/op/taint.t          - can&#39;t use empty path under Cygwin Perl
t/op/time.t           - no tzset()</code></pre>

</dd>
<dt id="Compiled-Perl-Source"><a class="permalink" href="perlcygwin.html#Compiled-Perl-Source">#</a><a id="Compiled"></a>Compiled Perl Source</dt>
<dd>

<pre><code class="plaintext">EXTERN.h              - __declspec(dllimport)
XSUB.h                - __declspec(dllexport)
cygwin/cygwin.c       - os_extras (getcwd, spawn, and several
                        Cygwin:: functions)
perl.c                - os_extras, -i.bak
perl.h                - binmode
doio.c                - win9x can not rename a file when it is open
pp_sys.c              - do not define h_errno, init
                        _pwent_struct.pw_comment
util.c                - use setenv
util.h                - PERL_FILE_IS_ABSOLUTE macro
pp.c                  - Comment about Posix vs IEEE math under
                        Cygwin
perlio.c              - CR/LF mode
perliol.c             - Comment about EXTCONST under Cygwin</code></pre>

</dd>
<dt id="Compiled-Module-Source"><a class="permalink" href="perlcygwin.html#Compiled-Module-Source">#</a><a id="Compiled1"></a>Compiled Module Source</dt>
<dd>

<pre><code class="plaintext">ext/Compress-Raw-Zlib/Makefile.PL
                      - Can&#39;t install via CPAN shell under Cygwin
ext/Compress-Raw-Zlib/zlib-src/zutil.h
                      - Cygwin is Unix-like and has vsnprintf
ext/Errno/Errno_pm.PL - Special handling for Win32 Perl under
                        Cygwin
ext/POSIX/POSIX.xs    - tzname defined externally
ext/SDBM_File/sdbm/pair.c
                      - EXTCONST needs to be redefined from
                        EXTERN.h
ext/SDBM_File/sdbm/sdbm.c
                      - binary open
ext/Sys/Syslog/Syslog.xs
                      - Cygwin has syslog.h
ext/Sys/Syslog/win32/compile.pl
                      - Convert paths to Windows paths
ext/Time-HiRes/HiRes.xs
                      - Various timers not available
ext/Time-HiRes/Makefile.PL
                      - Find w32api/windows.h
ext/Win32/Makefile.PL - Use various libraries under Cygwin
ext/Win32/Win32.xs    - Child dir and child env under Cygwin
ext/Win32API-File/File.xs
                      - _open_osfhandle not implemented under
                        Cygwin
ext/Win32CORE/Win32CORE.c
                      - __declspec(dllexport)</code></pre>

</dd>
<dt id="Perl-Modules/Scripts"><a class="permalink" href="perlcygwin.html#Perl-Modules/Scripts">#</a><a id="Perl"></a><a id="Perl-Modules-Scripts"></a>Perl Modules/Scripts</dt>
<dd>

<pre><code class="plaintext">ext/B/t/OptreeCheck.pm - Comment about stderr/stdout order under
                         Cygwin
ext/Digest-SHA/bin/shasum
                      - Use binary mode under Cygwin
ext/Sys/Syslog/win32/Win32.pm
                      - Convert paths to Windows paths
ext/Time-HiRes/HiRes.pm
                      - Comment about various timers not available
ext/Win32API-File/File.pm
                      - _open_osfhandle not implemented under
                        Cygwin
ext/Win32CORE/Win32CORE.pm
                      - History of Win32CORE under Cygwin
lib/Cwd.pm            - hook to internal Cwd::cwd
lib/ExtUtils/CBuilder/Platform/cygwin.pm
                      - use gcc for ld, and link to libperl.dll.a
lib/ExtUtils/CBuilder.pm
                      - Cygwin is Unix-like
lib/ExtUtils/Install.pm - Install and rename issues under Cygwin
lib/ExtUtils/MM.pm    - OS classifications
lib/ExtUtils/MM_Any.pm - Example for Cygwin
lib/ExtUtils/MakeMaker.pm
                      - require MM_Cygwin.pm
lib/ExtUtils/MM_Cygwin.pm
                      - canonpath, cflags, manifypods, perl_archive
lib/File/Fetch.pm     - Comment about quotes using a Cygwin example
lib/File/Find.pm      - on remote drives stat() always sets
                        st_nlink to 1
lib/File/Spec/Cygwin.pm - case_tolerant
lib/File/Spec/Unix.pm - preserve //unc
lib/File/Spec/Win32.pm - References a message on cygwin.com
lib/File/Spec.pm      - Pulls in lib/File/Spec/Cygwin.pm
lib/File/Temp.pm      - no directory sticky bit
lib/Module/CoreList.pm - List of all module files and versions
lib/Net/Domain.pm     - No domainname command under Cygwin
lib/Net/Netrc.pm      - Bypass using stat() under Cygwin
lib/Net/Ping.pm       - ECONREFUSED is EAGAIN under Cygwin
lib/Pod/Find.pm       - Set &#39;pods&#39; dir
lib/Pod/Perldoc/ToMan.pm - &#39;-c&#39; switch for pod2man
lib/Pod/Perldoc.pm    - Use &#39;less&#39; pager, and use .exe extension
lib/Term/ANSIColor.pm - Cygwin terminal info
lib/perl5db.pl        - use stdin not /dev/tty
utils/perlbug.PL      - Add CYGWIN environment variable to report</code></pre>

</dd>
<dt id="Perl-Module-Tests"><a class="permalink" href="perlcygwin.html#Perl-Module-Tests">#</a><a id="Perl1"></a>Perl Module Tests</dt>
<dd>

<pre><code class="plaintext">dist/Cwd/t/cwd.t
ext/Compress-Zlib/t/14gzopen.t
ext/DB_File/t/db-btree.t
ext/DB_File/t/db-hash.t
ext/DB_File/t/db-recno.t
ext/DynaLoader/t/DynaLoader.t
ext/File-Glob/t/basic.t
ext/GDBM_File/t/gdbm.t
ext/POSIX/t/sysconf.t
ext/POSIX/t/time.t
ext/SDBM_File/t/sdbm.t
ext/Sys/Syslog/t/syslog.t
ext/Time-HiRes/t/HiRes.t
ext/Win32/t/Unicode.t
ext/Win32API-File/t/file.t
ext/Win32CORE/t/win32core.t
lib/AnyDBM_File.t
lib/Archive/Extract/t/01_Archive-Extract.t
lib/Archive/Tar/t/02_methods.t
lib/ExtUtils/t/Embed.t
lib/ExtUtils/t/eu_command.t
lib/ExtUtils/t/MM_Cygwin.t
lib/ExtUtils/t/MM_Unix.t
lib/File/Compare.t
lib/File/Copy.t
lib/File/Find/t/find.t
lib/File/Path.t
lib/File/Spec/t/crossplatform.t
lib/File/Spec/t/Spec.t
lib/Net/hostent.t
lib/Net/Ping/t/110_icmp_inst.t
lib/Net/Ping/t/500_ping_icmp.t
lib/Net/t/netrc.t
lib/Pod/Simple/t/perlcyg.pod
lib/Pod/Simple/t/perlcygo.txt
lib/Pod/Simple/t/perlfaq.pod
lib/Pod/Simple/t/perlfaqo.txt
lib/User/grent.t
lib/User/pwent.t</code></pre>

</dd>
</dl>

<h1 id="BUGS-ON-CYGWIN"><a class="permalink" href="perlcygwin.html#BUGS-ON-CYGWIN">#</a><a id="BUGS"></a>BUGS ON CYGWIN</h1>

<p>Support for swapping real and effective user and group IDs is incomplete. On WinNT Cygwin provides <code>setuid()</code>, <code>seteuid()</code>, <code>setgid()</code> and <code>setegid()</code>. However, additional Cygwin calls for manipulating WinNT access tokens and security contexts are required.</p>

<h1 id="AUTHORS"><a class="permalink" href="perlcygwin.html#AUTHORS">#</a>AUTHORS</h1>

<p>Charles Wilson &lt;cwilson@ece.gatech.edu&gt;, Eric Fifer &lt;egf7@columbia.edu&gt;, alexander smishlajev &lt;als@turnhere.com&gt;, Steven Morlock &lt;newspost@morlock.net&gt;, Sebastien Barre &lt;Sebastien.Barre@utc.fr&gt;, Teun Burgers &lt;burgers@ecn.nl&gt;, Gerrit P. Haase &lt;gp@familiehaase.de&gt;, Reini Urban &lt;rurban@cpan.org&gt;, Jan Dubois &lt;jand@activestate.com&gt;, Jerry D. Hedden &lt;jdhedden@cpan.org&gt;.</p>

<h1 id="HISTORY"><a class="permalink" href="perlcygwin.html#HISTORY">#</a>HISTORY</h1>

<p>Last updated: 2012-02-08</p>


      </div>
      <div id="footer">
        <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p>

<p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p>


      </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <script src="../highlight.pack.js"></script>
    <script>hljs.highlightAll();</script>
  </body>
</html>
